You only have 10. What's the value of nbdy_nodes?
Yes, indeed when I do not call the function BDY_FLAG I get all running fine;
I debugged it and I was entering a part of memory not allocated!
Man, this can give you a lot of headaches!
thank you very much for helping
Best
CFD